package com.sunflower.common.core.validation.constraints;

import com.sunflower.common.core.validation.IsPhoneNumberValidator;
import com.sunflower.common.core.validation.enums.MobilePatternEnum;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.*;

/**
 * TODO
 *
 * @author: SunLuQuan
 * @Date: 2024年05月10日 09:41
 * @Description: IsPhoneNumber
 */
@Target(ElementType.FIELD)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {IsPhoneNumberValidator.class})
public @interface IsPhoneNumber {

    String message() default "{com.sunflower.constraints.IsPhoneNumber.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    MobilePatternEnum pattern() default MobilePatternEnum.MOBILE;

}
